
package requests

import (
	"github.com/goravel/framework/contracts/http"
	"github.com/goravel/framework/contracts/validation"
)

type SystemMenuRequest struct {

	Pid string `json:"pid" form:"pid"`

	Icon string `json:"icon" form:"icon"`

	MenuName string `json:"menu_name" form:"menu_name"`

	Module string `json:"module" form:"module"`

	Controller string `json:"controller" form:"controller"`

	Action string `json:"action" form:"action"`

	ApiUrl string `json:"api_url" form:"api_url"`

	Methods string `json:"methods" form:"methods"`

	Params string `json:"params" form:"params"`

	Sort string `json:"sort" form:"sort"`

	IsShow string `json:"is_show" form:"is_show"`

	IsShowPath string `json:"is_show_path" form:"is_show_path"`

	Access string `json:"access" form:"access"`

	MenuPath string `json:"menu_path" form:"menu_path"`

	Path string `json:"path" form:"path"`

	AuthType string `json:"auth_type" form:"auth_type"`

	Header string `json:"header" form:"header"`

	IsHeader string `json:"is_header" form:"is_header"`

	UniqueAuth string `json:"unique_auth" form:"unique_auth"`

	IsDel string `json:"is_del" form:"is_del"`

	Mark string `json:"mark" form:"mark"`

}

func (r *SystemMenuRequest) Authorize(ctx http.Context) error {
	return nil
}

func (r *SystemMenuRequest) Rules(ctx http.Context) map[string]string {
	return map[string]string{

		"pid": "required",

		"icon": "required",

		"menu_name": "required",

		"module": "required",

		"controller": "required",

		"action": "required",

		"api_url": "required",

		"methods": "required",

		"params": "required",

		"sort": "required",

		"is_show": "required",

		"is_show_path": "required",

		"access": "required",

		"menu_path": "required",

		"path": "required",

		"auth_type": "required",

		"header": "required",

		"is_header": "required",

		"unique_auth": "required",

		"is_del": "required",

		"mark": "required",

	}
}

func (r *SystemMenuRequest) Messages(ctx http.Context) map[string]string {
	return map[string]string{}
}

func (r *SystemMenuRequest) Attributes(ctx http.Context) map[string]string {
	return map[string]string{}
}

func (r *SystemMenuRequest) PrepareForValidation(ctx http.Context, data validation.Data) error {
	return nil
}
